package edu.zut.part4;

import java.util.Scanner;

public class ArrayDemo3 {
    public static void main(String[] args)
    {
        int[][] scores = new int[10][3];
        String[][] level = new String[10][3];
//        成绩输入
        for (int i = 0; i < scores.length; i++) {
            for (int j = 0; j <scores[i].length; j++)
            {
                System.out.println("请输入" + (i + 1) + "个学生的第" + (j + 1) + "成绩");
                Scanner input = new Scanner(System.in);
                scores[i][j] = input.nextInt();
            }
        }

//        成绩评定
        for (int i = 0; i < scores.length; i++)
        {
            for (int j = 0; j < scores[i].length; j++)
            {
                if (scores[i][j] <= 100 && scores[i][j] >= 0)
                    if (scores[i][j] >= 90)
                        level[i][j] = "优秀";
                    else if (scores[i][j] >= 60)
                        level[i][j]="合格";
                    else
                        level[i][j]="不合格";
                else
                    level[i][j]="你输入的成绩不合法";
            }
        }
        //        遍历成绩
        for (int i = 0; i < scores.length; i++)
        {
            System.out.println("第"+(i+1)+"个学生的成绩：");
            for (int j = 0; j < scores[i].length; j++)
            {
                System.out.print("第"+(j+1)+"门课程"+scores[i][j]+"  成绩评定等级："+level[i][j]);
            }
            System.out.println();
        }
    }
}
